//===============================================================================
//	TaskDataTable.h
//	
//===============================================================================

#pragma once

#include <unordered_map>
#include <vector>


class TaskData
{
public:
	TaskData(void)
		: m_sn(0)
		, m_taskid(0)
		, m_tasktype(0)
		, m_requiretype(0)
		, m_level(0)
		, m_prepose(0)
		, m_follow(0)
		, m_acceptnpc(0)
		, m_finishnpc(0)
	{}

	~TaskData(void)
	{}

public:
	void Clear(void)
	{
		m_sn = 0;
		m_taskid = 0;
		m_tasktype = 0;
		m_requiretype = 0;
		m_level = 0;
		m_prepose = 0;
		m_follow = 0;
		m_acceptnpc = 0;
		m_finishnpc = 0;
	}

public:
	uint32_t m_sn;
	int32_t m_taskid;
	int32_t m_tasktype;
	int32_t m_requiretype;
	int32_t m_level;
	int32_t m_prepose;
	int32_t m_follow;
	int32_t m_acceptnpc;
	int32_t m_finishnpc;
};


class TaskDataTable
{
public:
	TaskDataTable();
	~TaskDataTable();

public:
	TaskData* GetTaskDataById(uint32_t id);

	bool IsBandedNpcIdByMissionId(uint32_t missionId, uint32_t npcId);

private:
	bool addToIndex(int32_t id, uint32_t idx);

private:
	std::vector<TaskData> m_content;
	std::unordered_map<uint32_t, int32_t> m_index;
	uint32_t m_max_count;
};

